package com.qiqidream.admin.common.config;

import com.qiqidream.admin.common.factory.ResourceFactory;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author QiQiDream
 * @since 2019/11/25 14:11
 */
@Component
@PropertySource(value = "classpath:application-config.yml", factory = ResourceFactory.class)
@ConfigurationProperties(prefix = "jwt.config")
@Data
public class JwtConfig {
    /**
     * jwt 加密 key, 默认值：QiQiDream
     */
    private String key = "QiQiDream";

    /**
     * jwt 过期时间，默认值：600000 {@code 10 分钟}.
     */
    private Long ttl = 600000L;

    /**
     * 开启 记住我 之后 jwt 过期时间，默认值 604800000 {@code 7 天}
     */
    private Long remember = 604800000L;
}
